Next Steps

Part 2, Chapter 19


We've covered a lot in this course. Take a few minutes to step back and reflect on what you've learned. Ask yourself the following questions:

  1. What were my objectives?
  2. How far did I get? How much is left?
  3. How was the process? Am I on the right track?

Objectives:

  1. Develop an asynchronous RESTful API with Python and FastAPI
  2. Practice Test-Driven Development
  3. Test a FastAPI app with pytest
  4. Interact with a Postgres database asynchronously
  5. Containerize FastAPI and Postgres inside a Docker container
  6. Run unit and integration tests with code coverage inside a Docker container
  7. Check your code for any code quality issues via a linter
  8. Configure GitHub Actions for continuous integration and deployment
  9. Use GitHub Packages to store Docker Images
  10. Speed up a Docker-based CI build with Docker Cache
  11. Deploy FastAPI, Uvicorn, and Postgres to Heroku with Docker
  12. Parameterize test functions and mock functionality in tests with pytest
  13. Run tests in parallel with pytest-xdist
  14. Document a RESTful API with Swagger/OpenAPI
  15. Run a background process outside the request/response flow

Now it's your turn! Spend some time refactoring and dealing with tech debt on your own.

Some ideas:

  1. Test coverage: Add more tests to increase the overall test coverage.
  2. DRY out the code: There's plenty of places in the code base that could be refactored.
  3. CORS Middleware: Use CORSMiddleware to handle cross-origin requests -- e.g., requests that originate from a different protocol, IP address, domain name, or port to prevent CORS-based attacks.
  4. Security Vulnerability Scanners: Along with checking for code quality and style, linters can also be used for finding security vulnerabilities. Scan your-
  5. Third-Party Extensions: Try out some of the extensions from the Awesome FastAPI repo. Can't find what you need? Write your own!

Be sure to check out our advanced FastAPI courses as well:

  1. The Definitive Guide to Celery and FastAPI
  2. Scalable FastAPI Applications on AWS



✓ Mark as Completed